package com.financial.service.yspay.controller;

import com.financial.service.yspay.service.query.*;
import com.financial.service.yspay.utils.apiresult.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author WANGNING
 * @Email wyn20140226@aliyun.com
 * @Description //银盛支付所有查询接口
 * @Date 2019/11/19 9:34
 */
@RestController
@RequestMapping("/ysQuery")
public class FinancialYsQueryController {
    @Autowired
    private FinancialYsBalanceQueryService financialYsBalanceQueryService;

    @Autowired
    private FinancialYsPayQueryService financialYsPayQueryService;

    @Autowired
    private FinancialYsWithdrawalQueryService financialYsWithdrawalQueryService;

    @Autowired
    private FinancialYsSplitQueryService financialYsSplitQueryService;

    @Autowired
    private FinancialYsPaymentQueryService financialYsPaymentQueryService;

    @Autowired
    private FinancialYsRefundQueryService financialYsRefundQueryService;
    /**
     * 银盛余额查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/balance"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult balance(@RequestBody String requestParam) {

        return financialYsBalanceQueryService.balance(requestParam);
    }

    /**
     * 银盛报备查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/report"}, method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult report(@RequestBody String requestParam) {

        return null;
    }

    /**
     * 银盛分账查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/split"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult split(@RequestBody String requestParam) {

        return financialYsSplitQueryService.split(requestParam);
    }

    /**
     * 银盛支付查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/pay"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult pay(@RequestBody String requestParam) {

        return financialYsPayQueryService.pay(requestParam);
    }

    /**
     * 银盛提现查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/withdrawal"}, method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult withdrawal(@RequestBody String requestParam) {

        return financialYsWithdrawalQueryService.withdrawal(requestParam);
    }

    /**
     * 银盛代付查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/payment"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult payment(@RequestBody String requestParam) {

        return financialYsPaymentQueryService.payment(requestParam);
    }

    /**
     * 银盛退款查询
     * @param requestParam
     * @return
     */
    @RequestMapping(value = {"/refund"},method = {RequestMethod.POST})
    @ResponseBody
    public ApiResult refund(@RequestBody String requestParam) {

        return financialYsRefundQueryService.refund(requestParam);
    }
}
